//
//  EchoApiClient.m
//  Echo
//
//  Created by Liao on 14/12/24.
//  Copyright (c) 2014年 sina. All rights reserved.
//

#import "EchoApiClient.h"

@implementation EchoApiClient

+ (instancetype)sharedClient {
    static EchoApiClient *_sharedClient = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedClient = [[EchoApiClient alloc] initWithBaseURL:[NSURL URLWithString:ECHO_API_BASE_URL]];
        _sharedClient.requestSerializer = [AFJSONRequestSerializer serializer];
        [_sharedClient.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
        [_sharedClient.requestSerializer setValue:ECHO_API_DOMAIN forKey:@"Host"];
    });
    
    return _sharedClient;
}

@end
